﻿using System;
using System.Collections.Generic;
using System.Text;
using net.veekee.common;
using System.IO;
using net.veekee.common.reflection;
using net.veekee.logprocessor.plugin.input;

namespace net.veekee.logprocessor.plugin.gen
{
    public class GenFactory
    {
        private static List<String> registeredGenerics = new List<String>();

        public static String[] GetLoadedExtensions()
        {
            String[] array = new String[GenFactory.registeredGenerics.Count];
            GenFactory.registeredGenerics.CopyTo(array, 0);
            return array;
        }

        public static void Register(String extension, String readerAssembly)
        {
            if (GenFactory.registeredGenerics.Contains(extension))
            {
                Log.GetInstance().Error("Couldn't register '{0}' to extension '{1}' ; Extension has already been registered", readerAssembly, extension);
                return;
            }
            GenFactory.registeredGenerics.Add(extension);
        }
    }
}
